import Vue from 'vue'
import VueRouter from 'vue-router'
import LoginView from '../views/LoginView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'login',
    component: LoginView
  },
  {
    path: '/dorm',
    name: 'dorm',
    component: () => import('@/layout/BaseLayout.vue'),
    redirect: '/index',
    children: [
      {
        path: '/index',
        name: 'index',
        component: () => import('@/views/firstpage/FirstView.vue'),
      },
      {
        path: '/user',
        name: 'user',
        component: () => import('@/views/UserView.vue')
      },
      {
        path: '/building',
        name: 'building',
        component: () => import('@/views/buildingpage/BuildingView.vue'),
      },
      {
        path: '/dormitory',
        name: 'dormitory',
        component: () => import('@/views/dormpage/DormView.vue'),
      },
      {
        path: '/student',
        name: 'student',
        component: () => import('@/views/studentpage/StudentView.vue'),
      },
      {
        path: '/info',
        name: 'info',
        component: () => import('@/views/selfInfopage/SelfInfoView.vue'),
      },
    ]
  },
  // {
  //   path: '/register',
  //   name: 'register',
  //   component: () => import('../views/RegisterView.vue')
  // }
]

const router = new VueRouter({
  routes
}) 

export default router
